import Mock from 'mockjs'

/**
 * @date: 2024-07-16 16:35:07
 * @description: 首页图表数据
 * @modifyContent:
 * @author: Forever丿顾北
**/


const getStatisticalData = () => {
  const List = []
  for(let i = 0; i < 7; i++) {
    List.push(
      Mock.mock({
        苹果: Mock.Random.float(100, 8000, 0, 0),
        VIVO: Mock.Random.float(100, 8000, 0, 0),
        OPPO: Mock.Random.float(100, 8000, 0, 0),
        魅族: Mock.Random.float(100, 8000, 0, 0),
        华为: Mock.Random.float(100, 8000, 0, 0),
        三星: Mock.Random.float(100, 8000, 0, 0),
        小米: Mock.Random.float(100, 8000, 0, 0)
      })
    )
  }
  return {
    code: 200,
    data: {
      // 饼图
      videoData: [
        {
          name: 'VIVO',
          value: 1555,
        }, {
          name: 'OPPO',
          value: 2000,
        }, {
          name: '华为',
          value: 3000,
        },  {
          name: '小米',
          value: 2500,
        }
      ],
      // 柱形图
      userData: [
        {
          date: '周一',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周二',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周三',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周四',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周五',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周六',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }, {
          date: '周日',
          new: Mock.Random.float(100, 8000, 0, 0),
          active: Mock.Random.float(100, 8000, 0, 0),
        }
      ],
      // 折线图
      orderData: {
        date: ['2020-10-01', '2020-10-02', '2020-10-03', '2020-10-04', '2020-10-05', '2020-10-06', '2020-10-07'],
        data: List
      },
      // 表格数据
      tableData: [
        {
          name: '苹果',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: Mock.Random.float(10, 8000, 0, 0)
        }, {
          name: 'VIVO',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: Mock.Random.float(10, 8000, 0, 0)
        }, {
          name: 'OPPO',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: Mock.Random.float(10, 8000, 0, 0)
        }, {
          name: '魅族',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: Mock.Random.float(10, 8000, 0, 0)
        }, {
          name: '华为',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: Mock.Random.float(10, 8000, 0, 0)
        }, {
          name: '三星',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: 22500
        }, {
          name: '小米',
          todayBuy: Mock.Random.float(10, 8000, 0, 0),
          monthBuy: Mock.Random.float(10, 8000, 0, 0),
          totalBuy: 22500
        }
      ],
      // 统计数据
      countData: [
        {
          name: '今日支付订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'FieldTimeOutlined',
          color: '#2ec7c9'
        }, {
          name: '今日收藏订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'FieldTimeOutlined',
          color: '#2ffb98'
        }, {
          name: '今日未支付订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'ContainerOutlined',
          color: '#5ab1ef'
        }, {
          name: '本月支付订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'ContainerOutlined',
          color: '#2ec7c9'
        }, {
          name: '本月收藏订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'ContainerOutlined',
          color: '#ffb980'
        }, {
          name: '本月未支付订单',
          value: Mock.Random.float(10, 8000, 0, 0),
          icon: 'ContainerOutlined',
          color: '#5ab1ef'
        }
      ]
    }
  }
}

const Home = {
  getStatisticalData // 首页图表数据
};

export default Home;